import java.util.stream.Collectors

def main(List args){

    def a =args.getFirst();
    def m=a.get("main");
    def sub=a.get("sub");

    for(def c in m ){

        def id =  c.get("id");

        def collect = sub.stream().collect(Collectors.groupingBy { v ->
            {
                return v.get("room_id")
            }
        })
        c.put("mermbers",collect.get(id));
    }
    return m;
}